<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:body>
        <ui:composition template="/WEB-INF/jsf2/templates/templateBasic.xhtml">
            <ui:define name="top">
                <ui:include src="/WEB-INF/jsf2/templates/templateNavigation.xhtml"/>
            </ui:define>
            <ui:define name="bottom">
                <ui:include src="/WEB-INF/jsf2/templates/templateBottom.xhtml"/>
            </ui:define>

            <ui:define name="content">

                <f:loadBundle basename="com.gq2.multilang.championship" var="txt_cha"/>
                <f:loadBundle basename="com.gq2.multilang.granq" var="txt_com"/>

                <h3>
                    <h:outputFormat value="#{txt_cha.editChampionship}"/>
                </h3>
		<h:messages />
                <h:form id="championship_form" >
                    <h:inputHidden id="runAction" value="#{championship.chaId}" />
                    <table>
                        <tr>
                            <td>
                                <h:panelGrid columns="2">
                                    <h:outputLabel value="#{txt_cha.Id}:" for="keyId" ></h:outputLabel>
                                    <h:outputText id="keyId" value="#{championship.chaId}" />


                                    <h:outputLabel value="#{txt_com.Status}:" for="status" ></h:outputLabel>
                                    <h:selectOneRadio id="status" value="#{championship.chaStatus}" >
                                        <f:selectItem id="status_0" itemValue="0" itemLabel="#{txt_com.Activ}"/>
                                        <f:selectItem id="status_1" itemValue="1" itemLabel="#{txt_com.Finished}"/>
                                        <f:selectItem id="status_2" itemValue="2" itemLabel="#{txt_com.Locked}"/>
                                    </h:selectOneRadio>

                                    <h:outputLabel value="#{txt_com.Code}:" for="code" ></h:outputLabel>
                                    <h:inputText id="code" size="12" maxlength="12" value="#{championship.chaCode}" />


                                    <h:outputLabel value="#{txt_com.Description}:" for="description" ></h:outputLabel>
                                    <h:inputText id="description" size="60" maxlength="60" value="#{championship.chaDescription}" />


                                    <h:outputLabel value="#{txt_cha.Phase}:" for="season" ></h:outputLabel>
                                    <h:inputText id="season" size="12" maxlength="12" value="#{championship.chaSeason}" />


                                    <h:outputLabel value="#{txt_cha.startDate}:" for="startDate" ></h:outputLabel>
                                    <h:panelGroup>
                                        <h:inputText id="startDate" size="10" maxlength="10" value="#{championship.chaStartDate}"  >
                                            <f:convertDateTime pattern="dd/MM/yyyy"></f:convertDateTime>
					</h:inputText>
                                        #{txt_com.dateFormat}
                                    </h:panelGroup>

                                    <h:outputLabel value="#{txt_cha.pointsForWin}:" for="pointsForWin" ></h:outputLabel>
                                    <h:inputText id="pointsForWin" size="5" maxlength="5" value="#{championship.chaPointsWin}" >
					<f:validateLongRange minimum="0" maximum="3"/>
				    </h:inputText>


                                    <h:outputLabel value="#{txt_cha.pointsForDraw}:" for="pointsForDraw" ></h:outputLabel>
                                    <h:inputText id="pointsForDraw" size="5" maxlength="5" value="#{championship.chaPointsDraw}" >
					<f:validateLongRange minimum="0" maximum="3"/>
				    </h:inputText>

                                    <h:outputLabel value="#{txt_cha.pointsForLose}:" for="pointsForLose" ></h:outputLabel>
                                    <h:inputText id="pointsForLose" size="5" maxlength="5" value="#{championship.chaPointsLose}" >
					<f:validateLongRange minimum="0" maximum="3"/>
				    </h:inputText>


                                    <h:outputLabel value="#{txt_cha.maxTeams}:" for="maxTeams" ></h:outputLabel>
                                    <h:inputText id="maxTeams" size="5" maxlength="5" value="#{championship.chaMaxTeams}"  onblur="validar_campo_entero(this);"/>

                                    <h:panelGroup/>
                                    <h:panelGroup>
                                        <table>
                                            <tr>
                                                <td>
                                                    <h:commandButton id="cancel" action="#{championship.cancel}" value="#{txt_com.Cancel}" />
                                                    <h:commandButton id="save" action="#{championship.save}" value="#{txt_com.Save}" />
                                                </td>
                                            </tr>
                                        </table>
                                    </h:panelGroup>
                                </h:panelGrid>
                            </td>
                        </tr>
                    </table>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>

</html>

